﻿using System;
using System.Collections.Generic;

namespace FlitBit.Cache
{
	/// <summary>
	///   Interface for cache eviction monitors.
	/// </summary>
	public interface ICacheEvictionMonitor : IDisposable
	{
		/// <summary>
		///   Gets the keys identifying which cache contexts the monitor is interested in.
		/// </summary>
		IEnumerable<string> ContextKeys { get; }

		/// <summary>
		///   Gets the monitor's registration key.
		/// </summary>
		Guid RegistrationKey { get; }

		/// <summary>
		///   Invoked by the framework when cache evictions arrive.
		/// </summary>
		/// <param name="contextKey">a context key</param>
		/// <param name="evictionInfo">the eviction info</param>
		void OnEvictionNotification(string contextKey, object evictionInfo);
	}
}